/*
 * @Description: 病虫害信息管理
 */
import zhreq from "@/api/axios";
export default {
  /**
   * @description: 添加病虫害信息
   * @param {Object}  *
   */
  add(params) {
    return zhreq.post("/v3/patrol/insect/add", params);
  },
  /**
   * @description: 修改病虫害信息
   * @param {Object}  *
   */
  edit(params) {
    return zhreq.put("/v3/patrol/insect/edit", params);
  },
  /**
   * @description: 删除病虫害信息
   * @param {Object}  *
   */
  delById(id) {
    return zhreq.delete(`/v3/patrol/insect/delById?id=${id}`);
  },
  /**
   * @description: 批量删除病虫害信息
   * @param {Object}  *
   */
  delListById(ids) {
    return zhreq.delete(`/v3/patrol/insect/delListById?ids=${ids}`);
  },
  /**
   * @description: 条件查询病虫害信息
   * @param {Object}  *
   */
  queryByCondition(params) {
    return zhreq.post("/v3/patrol/insect/queryByCondition", params);
  },
  /**
   * @description: 分页条件查询病虫害信息
   * @param {Object}  *
   */
  queryPageByCondition(params) {
    return zhreq.post("/v3/patrol/insect/queryPageByCondition", params);
  },
  /**
   * @description: 上传图片
   * @param {Object}  *
   */
  addMultipart(params) {
    return zhreq.post("/v3/patrol/picture/addMultipart", params);
  },
  /**
   * @description: 查询图片
   * @param {Object}  *
   */
  queryPicture(id) {
    return zhreq.get(`/v3/patrol/picture/query?pictureId=${id}`);
  },
  /**
   * @description: 批量查询图片
   * @param {Object}  *
   */
  queryPictureList(ids) {
    return zhreq.get(`/v3/patrol/picture/queryListById?pictureIdList=${ids}`);
  },
  // 根据病害查虫害名称
  queryAlarmName(params) {
    return zhreq.post('/v3/patrol/insect/queryByCondition',{
      ...params
    })
  }
};
